const Layout = () => import("@/layout/index.vue");

export default [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录",
      showLink: false,
      rank: 101
    }
  },
  {
    path: "/redirect",
    component: Layout,
    meta: {
      title: "加载中...",
      showLink: false,
      rank: 102
    },
    children: [
      {
        path: "/redirect/:path(.*)",
        name: "Redirect",
        component: () => import("@/layout/redirect.vue")
      }
    ]
  },
  {
    path: "/permission",
    component: Layout,
    meta: {
      title: "权限管理",
      icon: "ep:lollipop",
      rank: 10
    },
    children: [
      {
        path: "/permission/page/index",
        name: "PermissionPage",
        meta: {
          title: "页面权限",
          roles: ["admin", "common"]
        }
      },
      {
        path: "/permission/button",
        meta: {
          title: "按钮权限",
          roles: ["admin", "common"]
        },
        children: [
          {
            path: "/permission/button/router",
            component: () => import("@/views/permission/button/index.vue"),
            name: "PermissionButtonRouter",
            meta: {
              title: "路由返回按钮权限",
              auths: [
                "permission:btn:add",
                "permission:btn:edit",
                "permission:btn:delete"
              ]
            }
          },
          {
            path: "/permission/button/login",
            component: () => import("@/views/permission/button/perms.vue"),
            name: "PermissionButtonLogin",
            meta: {
              title: "登录接口返回按钮权限"
            }
          }
        ]
      }
    ]
  }
] satisfies Array<RouteConfigsTable>;
